package com.eascs.admin.o2o.oaotodata.trans;


import java.util.Date;

import com.eascs.admin.common.utils.StringUtils;
/**
* @author bao.pan 2016年12月22日 上午11:04:17
*/
import com.eascs.admin.o2o.loan.entity.O2oLoanapplyEntity;
import com.eascs.admin.o2o.oaotodata.entity.OaO2oLoanapply;
import com.eascs.web.sso.User;
import com.eascs.web.sso.UserHolder;
public class O2oOATransEntity {
	public static O2oLoanapplyEntity OAorO2oLoanapplyEntity(OaO2oLoanapply oa){
		O2oLoanapplyEntity o2o =new O2oLoanapplyEntity();
		o2o.setLoanapplyNo(String.valueOf(oa.getLoanapplyno()));
		o2o.setBankAccount(oa.getBankaccount());
		o2o.setBankActno(oa.getBankActno());
		o2o.setBankAmount(oa.getBankAmount());
		o2o.setBankApplyno(oa.getBankApplyno());
		o2o.setBankFlg(oa.getBankFlg());
		o2o.setBankLoanName(oa.getBankLoanName());
		o2o.setBankOsn(oa.getBankOsn());
		o2o.setBankStatus(oa.getBankStatus());
		o2o.setBankType(oa.getBanktype());
		o2o.setBcFlag(oa.getBcFlag());
		o2o.setBillCode(oa.getBillcode());
		o2o.setCreateDate(oa.getCreatedate());
		o2o.setCreatRo(StringUtils.valueOf(oa.getCreator()));
		o2o.setCreditline(oa.getCreditline());
		o2o.setCreditRange(StringUtils.valueOf(oa.getCreditrange()));
		o2o.setCustomerCode(oa.getCustomercode());
		o2o.setCustomeRname(oa.getCustomername());
		o2o.setCustomerNo(StringUtils.valueOf(oa.getCustomerno()));
		o2o.setCustomerSalesamount(oa.getCustomersalesamount());
		o2o.setCustomerType(oa.getCustomerType());
		o2o.setDataSource("2");
		o2o.setDepositrate(oa.getDepositrate());
		o2o.setEaCooperationDate(oa.getEacooperationdate());
		o2o.setEaMount(oa.getLoanamount());
		o2o.setEaPurchaseamount(oa.getEapurchaseamount());
		o2o.setGuarAnteeWay(oa.getGuaranteeway());
		o2o.setInstrumentNumber(oa.getInstrumentnumber());
		o2o.setIslock(oa.getIslock());
		o2o.setLoanaMount(oa.getLoanamount());
		o2o.setLoanapplynoMain(StringUtils.valueOf(oa.getLoanapplynoMain()));
		o2o.setLoanFlg(oa.getLoanFlg());
		o2o.setLoanrate(oa.getLoanrate());
		o2o.setLoanTerm(Integer.valueOf(oa.getLoanterm()));
		o2o.setLoanType(oa.getLoanType());
		o2o.setLtd(String.valueOf(oa.getLtd()));
		o2o.setLtdCode(oa.getLtdCode());
		o2o.setLtdName(oa.getLtdName());
		o2o.setManagefeerate(oa.getManagefeerate());
		o2o.setOperatorName(oa.getOperatorname());
		o2o.setOperatorNo(StringUtils.valueOf(oa.getOperatorno()));
		o2o.setPayDate(StringUtils.formatDate(oa.getPaydate()));
		o2o.setPaymentTime(oa.getPaymentTime());
		o2o.setReceiveBank(oa.getReceivebnk());
		o2o.setReferrerName(oa.getOperatorname());
		o2o.setReferrerNo(StringUtils.valueOf(oa.getOperatorno()));
		o2o.setRemark(oa.getRemark());
		o2o.setRepaymentSource(oa.getRepaymentsource());
		o2o.setRepayMentway(oa.getRepaymentway());
		o2o.setRisk(oa.getRiskdepositrate());
		o2o.setSubmitDate(oa.getSubmitdate());
		o2o.setSubmitRo(StringUtils.valueOf(oa.getCreator()));
		o2o.setWfType(oa.getWfType());
		o2o.setCustomerSalesamount(oa.getCustomersalesamount());
		o2o.setEndDate(new Date());
		o2o.setEndRo(UserHolder.getUser().getNo());
		o2o.setLoanId(oa.getLoanId());
		o2o.setIsPlaceOnFile(oa.getIs_place_on_file());
		return o2o;
	}
}
